package gov.nasa.anml.lifted;

import gov.nasa.anml.PDDL;
import gov.nasa.anml.State;
import gov.nasa.anml.PDDL.FloatExpression;
import gov.nasa.anml.utility.*;

public class ANMLInteger extends SimpleInteger implements ConstantExpression<SimpleInteger> {

	public static final iHashMap<ANMLInteger> pool = new iHashMap<ANMLInteger>();
	public static final ANMLInteger One = make(1);
	public static final ANMLInteger Zero = make(0);

	public static ANMLInteger make(int v) {
		ANMLInteger probe = pool.get(v);
		if (probe == null) {
			probe = new ANMLInteger(v);
			pool.put(v,probe);
		}
		return probe;
	}

	protected ANMLInteger(int v) {
		super(v);
	}
	
	public ANMLInteger value(State s) {
		return this;
	}
	
	public ANMLInteger value() {
		return this;
	}

	public TypeCode typeCode() {
		return TypeCode.Integer;
	}

	public History<SimpleVoid> storage(State p, State c) {
		return null;
	}

	public boolean apply(State p, int contextID, State c) {
		return false;
	}

	
	public transient PDDL.FloatLiteral asPDDLFloatExpression;
	
	public PDDL.FloatExpression asPDDLFloatExpr() {
		return asPDDLFloatExpression;
	}
	
	public PDDL.Argument translateArgument(PDDL pddl, Interval unit) {
		return null;
	}

	public PDDL.FloatExpression translateExpr(PDDL pddl, Interval unit) {
		return asPDDLFloatExpression = pddl.new FloatLiteral(v);
	}
	public void translateDecl(PDDL pddl, Interval unit) {
	}	
	public PDDL.Expression translateLValue(PDDL pddl, Interval unit) {
		return null;
	}


	public void translateStmt(PDDL pddl, Interval unit, PDDL.Time part) {
		unit.getPDDLConditions().add(pddl.FalseCondition);
	}
	

}